/**
 * Created by hongye.liu on 14-10-30.
 */

define(['jquery','underscore','backbone','global','text!/android_asset/busAppWeb/module/busApp/busNearby/busNearby.html'],
    function($,_,Backbone,global,html){
        var busLineView = Backbone.View.extend({
            template: _.template(html),
            initialize:function(data){
                this.render();
                this.addListener();
            },
            render:function(){
                $('div#contentID').html(this.template);
                $('body').trigger("create");
            },
            addListener:function(){
                $(document).ready(function(){
                    $('#searchNearbyBtn').click(function(){
                        var local = new BMap.LocalSearch(global.map,
                            { renderOptions:{map: global.map,panel:searchNearByResult ,autoViewport: true}});
                        local.searchNearby($('#nearBy')[0].value,new BMap.Point(global.longitude, global.latitude));
                    })
                })

            }
        });
        return busLineView;

    }
)